package com.openatc.agent.config;

//import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author ：panleilei
 * @description
 * @modified By：
 * @version:
 * @date ：Created in 2024/12/6 17:31
 */
@Configuration
//@ConditionalOnProperty(prefix = "validate",name = "enable",havingValue = "true")
public class InterceptorConfig implements WebMvcConfigurer {
    @Resource
    private DateVerifyInterceptor dateVerifyInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(dateVerifyInterceptor).addPathPatterns("/**").order(-1);
    }
}
